package com.jeesite.common.utils.excel.fieldtype;

import java.util.List;

import org.springframework.util.StringUtils;

import com.jeesite.modules.edu.entity.EduTalent;
import com.jeesite.modules.sys.entity.Employee;
import com.jeesite.modules.sys.utils.DictUtils;
import com.jeesite.modules.sys.utils.EduUtils;

public class EduTalentType {
	
	public static String setValue(Object empCode) {
		EduTalent eduTalent = new EduTalent();
		Employee employee = new Employee();
		employee.setEmpCode(String.valueOf(empCode));
		eduTalent.setEmployee(employee);
		List<EduTalent> talents = EduUtils.getEduTalents(eduTalent);
		StringBuffer sb = new StringBuffer();
		for(EduTalent talent :talents) {
			String year = talent.getTalentYear();
			if(StringUtils.isEmpty(year)) {
				year="2019";
			}
			sb.append("("+talent.getTalentYear()+") " + DictUtils.getDictLabel("sys_talent", talent.getTalentCode(), "未知"));
			sb.append("\n");
		}
		return sb.toString();
	}
}
